package group2assignone.ucm.manager;

import group2assignone.model.Flight;
import group2assignone.ucm.UCController;
import group2assignone.view.manager.EditFlightView;

/**
 * Use Case: Edit Flight Back                                               <br>
 * Pre-Condition: Manager selects 'Back' from the edit flight view          <br>                                        <br>
 * Post-Condition: UI is updated                                            <br>
 * 1. System clears current edit flight view.                               <br>
 * 2. System returns to previous edit flight view.                          <br>
 *
 * @author group2
 */
public class UCEditFlightBack implements UCController {

    private EditFlightView editView;

    /**
     * sets view and flight
     * @param eView
     * @param flight
     */
    public UCEditFlightBack(EditFlightView eView) {
        editView = eView;
    }

    /**
     *Use Case Controller - allows the manager to go back from editing flight
     */
    @Override
    public void run() {
        //1. System clears current edit flight view.
        editView.clearShowFlightWindow();
        //2. System returns to previous edit flight view.
        editView.go();

    }
}
